package com.hgsf.util;

public class FormVerify {
	private static final String USERID_REGEX = "[0-9]+";
	private static final String PHONENUMBER_REGEX = "[0-9]{5,11}";
	private static final String NUMBER_REGEX = "[0-9]{1,4}";

	/**
	 * 用户标号合法性验证
	 * 
	 * @return
	 */
	public static boolean useridVerify(String userid) {
		return userid.matches(USERID_REGEX);
	}

	/**
	 * 电话号码合法性验证
	 * 
	 * @param phonenumber
	 * @return
	 */
	public static boolean telephoneVerify(String phonenumber) {
		return phonenumber.matches(PHONENUMBER_REGEX);
	}

	/**
	 * 数字合法性验证
	 * 
	 * @param phonenumber
	 * @return
	 */
	public static boolean numberVerify(String number) {
		return number.matches(NUMBER_REGEX);
	}
}
